home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3878 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.cais.com!NewsWatcher!user
  2. From: lbecker@avtec.com (Lynn Becker)
  3. Newsgroups: comp.unix.solaris,comp.unix.programmer,comp.lang.c
  4. Subject: inline code
  5. Date: Wed, 31 Jan 1996 13:34:21 -0500
  6. Organization: Avtec Systems Inc
  7. Distribution: inet
  8. Message-ID: <lbecker-3101961334210001@206.161.148.20>
  9. NNTP-Posting-Host: 206.161.148.20
  10. X-Newsreader: Yet Another NewsWatcher 2.2.0b4
  11.  
  12. Hi,
  13.  
  14. I have some code that I am trying to port to the SparcStation 20 (Solaris 2.4).
  15. We have the sparcworks c compiler. (/opt/SUNWspro/bin/cc) and it is
  16. choking on an inline keyword (directive to the previous compiler?). I am
  17. looking at the manual and the man pages, but haven't decided whether there
  18. is a way to make the sun comiler accepts this notation.  Does the gcc
  19. compiler accept this? Here is a snippet of the code I am using.
  20.  
  21.  
  22. inline double mathFindVectorMag
  23. (
  24.    CARTESIAN_STRUCT *   pVector
  25. )
  26. {
  27.    return sqrt (pVector->X * pVector->X + pVector->Y * pVector->Y + 
  28.                pVector->Z * pVector->Z);
  29. }
  30.  
  31. The sun compiler gives me an error:
  32.  
  33. mathVectorRoutines.c:
  34. "./mathVectorRoutines.h", line 43: undefined or not a type: inline
  35.  
  36. -- 
  37. Lynn W. Becker                          lbecker@avtec.com
  38. Avtec Systems Inc                       (703) 273-2211
  39. 10530 Rosehaven Street, Suite 300       (703) 273-1313 FAX
  40. Fairfax, VA 22030
  41.